#include "generator/graph.h"
#include <stdio.h>
#include <assert.h>
#include "print_trimatrix.h"

static const char* segstr[] = { "SPAWN", "GOAL", "CORRIDOR", "MULTIPLEXER", "SHORTCUT", "TREASURE", "MONSTERS", "BOSS", "SWITCHES", "SOKOBAN", "MULTIPLAYER" };

void print_graph (Graph* graph)
{
#ifndef NOPRINT
  printf ("(Graph)\n");
  printf ("  n_segments = %d\n", graph->n_segments);

  for (int i = 0; i < graph->n_segments; i++)
  {
    Segment segment = graph->segment[i];
    assert((segment.type >= 0) && (segment.type < (sizeof(segstr) / sizeof(char*))));

    printf ("  (type = %s; intensity = %d)\n", segstr[segment.type], segment.intensity);
  }

  printf ("  path:\n");
  print_trimatrix (graph->path);
#endif
}

